* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    background-color: #10a37f;
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
}

#clear-chat {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#clear-chat:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    text-align: center;
    color: #666;
    margin-top: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user .message-content {
    background-color: #10a37f;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background-color: #e5e5ea;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 12px;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#user-input:focus {
    border-color: #10a37f;
}

#send-btn {
    padding: 12px 24px;
    background-color: #10a37f;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#send-btn:hover {
    background-color: #0d8a6c;
}

#send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 加载动画 */
.loading {
    display: inline-block;
    padding: 8px 16px;
}

.loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10a37f;
    border-radius: 50%;
    margin: 0 2px;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .message {
        max-width: 90%;
    }
}